class SurveyPermissionType < ActiveRecord::Base
	include AliasingColumns
        
  	set_table_name "SURVEY_PERMISSION_TYPES"
	AliasingColumns.add_aliases columns
		
	has_many :permissions,
			 :class_name => "UsersSurveysPermission",
			 :foreign_key => "permission_type_id",	   
			 :dependent => :destroy
		
			 
			 	 
	if  AliasingColumns.get_adapter_name == "oracle"
#		self.primary_key ="ID"	
		set_sequence_name table_name()<<"_SEQ" 
	#	before_create :set_id
		def set_id
			 self.ID =connection.next_sequence_value(self.class.sequence_name)	
		end 
	end
				 
			 
end
